package InnerClass;

public class StaticInnerClass {
    private String name="顾新宇";
    private int age=21;
    private String address = "苏州";
      //静态内部类和外部类同一级别
     static class Inner{
         private String address="上海";
         private String phone="111";
         private   static int count=100;

         public void show(){
             //调用外部类的属性
             //先实例化外部类再调用
             StaticInnerClass out= new StaticInnerClass();
             System.out.println(out.name);
             //调用静态内部类的属性和方法
             System.out.println(this.address);
             //调用静态内部类的静态属性
             System.out.println(Inner.count);
         }
    }

    public static void main(String[] args) {
        //直接创建静态内部类的对象
        StaticInnerClass.Inner inner= new StaticInnerClass.Inner();
        inner.show();
    }
}
